Ext.define('DespreImobiliare.view.latestactivity.LatestActivity', {
	extend : 'Ext.panel.Panel',
	alias : 'widget.latestactivity',

	requires : [ 'Ext.view.View' ],

	border : false,
	cls: 'iScroll',
	autoScroll : true,

	items : {
		xtype : 'dataview',
		store : 'LatestActivityStore',

		tpl : [ '<tpl for=".">', '<div class="latest-activity-wrap">', '<div>',
				'<img src="{image}" />',
				' {[Ext.Date.format(values.date, "d.m.Y H:i:s")]}', '</div>',
				'<div>{title}</div>',
				'<div><span>{[values.content.substring(0, 75) + "..."]}</div>',
				'</div>', '</tpl>' ],

		singleSelect : true,
		overItemCls : 'latest-activity-over',
		selectedItemCls : 'latest-activity-selected',
		itemSelector : 'div.latest-activity-wrap',
		emptyText : 'No latest activity available',

		listeners : {
			itemclick : function(thisView, record) {
				// alert(record.data.date);
			}
		}
	}

});